// wigets/business/product-group/product-group.js
const componentBehavior = require('../../../js/common/ComponentBehavior')

Component({
  behaviors: [componentBehavior],
  /**
   * 组件的属性列表
   */
  properties: {
    groupList: { // 商品组合列表
      type: Array,
      value: []
    }
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    change (e) {
      let index = e.currentTarget.dataset.index
      let list = this.data.groupList
      if (list[index].IsSelected == 1) {
        return
      }
      this.triggerEvent('change', {
        id: list[index].ProductId
      })
    }
  }
})